using Blog.Repository;
using Blog.Service;
using Blog.Service.Role;
using Blog.Service.Role.Input;
using Blog.Service.Role.Output;
using Microsoft.AspNetCore.Mvc;
using XjjXmm.Infrastructure.Repository;
using XjjXmm.Infrastructure.Repository.Model;

namespace Blog.API.Controllers;



/// <summary>
/// 角色
///</summary>
[ApiController]
[Route("api/admin/[controller]/[action]")]
public class RoleController  : CrudController<RoleModel>
{
    private readonly IRoleService _roleService;

    public RoleController(IRoleService service) : base(service)
    {
        this._roleService = service;
    }

    /// <summary>
    /// 查询分页角色
    /// </summary>
    /// <param name="model"></param>
    /// <returns></returns>
    [HttpPost]
    public async Task<PageOutput<RoleListOutput>> GetPage(PageInput<RoleListInput> model)
    {
        return await _roleService.Page(model);
    }
}